package org.example.http;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author lilei
 * @date 2020-04-06
 */
public class BResponse {
    private OutputStream out;

    public BResponse(OutputStream out) {
        this.out = out;
    }

    public void write(String context) throws IOException {
        String stringBuffer = "HTTP/1.1 200 OK\n" +
                "Content-Type: text/html\n" +
                "\r\n" +
                context;
        out.write(stringBuffer.getBytes());
    }
}
